home *** CD-ROM | disk | FTP | other *** search
/ Linux Cubed Series 4: GNU Archives / Linux Cubed Series 4 - GNU Archives.iso / gnu / glibc-1.09 / glibc-1 / glibc-1.09.1 / sysdeps / unix / sysv / sco3.2.4 / direct.h < prev    next >
Encoding:
C/C++ Source or Header  |  1994-07-18  |  604 b   |  23 lines

  1. #ifndef    MAXNAMLEN
  2. #define    MAXNAMLEN    512
  3. #endif
  4. #define DIRBUF            1048    /* minimum buffer size for call to getdents */
  5.  
  6. struct direct
  7.   {
  8.     unsigned short int d_fileno;
  9.     short int d_pad;
  10.     long int d_off;
  11.     unsigned short int d_reclen;
  12.     char d_name[1];        /* Actually longer. */
  13.   };
  14.  
  15. #include <stddef.h>
  16.  
  17. /* We calculate the length of the name by taking the length of the whole
  18.    `struct direct' record, subtracting the size of everything before the
  19.    name, and subtracting one for the terminating null.  */
  20.  
  21. #define D_NAMLEN(d) \
  22.   ((d)->d_reclen - offsetof (struct direct, d_name) - 1)
  23.